package com.jubao.ejb.business;

import java.util.List;

import com.jubao.ejb.entity.CouponItem;
import com.jubao.ejb.entity.Product;
import com.jubao.ejb.entity.Store;
import com.jubao.ejb.entity.User;
import com.jubao.ejb.entity.UserWebsite;

public interface UserBusiness {
	/**
	 * save user managed store
	 * 
	 * @param userSysId
	 * @param store
	 * @return if succ,return user with store set as its' managedStore field, fail return null
	 */
	public User saveManagedStore(long userSysId, Store store);

	/**
	 * Find user favorite website
	 * 
	 * @param userSysId
	 * @param websiteSysId
	 * @return
	 */
	public UserWebsite findFavoriteWebsite(long userSysId, long websiteSysId);

	public void deleteUserFavoriteWebSite(long userSysId, long websiteSysId);

	/**
	 * Save user favorite website
	 * 
	 * @param userSysId
	 * @param websiteSysId
	 * @param userWebsite
	 * @return
	 */
	public UserWebsite saveFavoriteWebsite(long userSysId, long websiteSysId, UserWebsite userWebsite);

	/**
	 * get user favorite website list
	 * 
	 * @param userSysId
	 * @param pgno
	 * @param pgsize
	 * @return
	 */
	public List<UserWebsite> getFavoriteWebSiteList(long userSysId, int pgno, int pgsize);

	/**
	 * get total count of user favorite website
	 * 
	 * @param userSysId
	 * @return
	 */
	public long getFavoriteWebSiteCount(long userSysId);

	/**
	 * get servants who are member of areaCategory and businessCategory
	 * 
	 * @param areaCategorySysId
	 * @param businessCategorySysId
	 * @param pgno
	 * @param pgsize
	 * @return
	 */
	public List<User> getServantList(long areaCategorySysId, long businessCategorySysId, int pgno, int pgsize);

	/**
	 * get count of servants who are member of areaCategory and businessCategory
	 * 
	 * @param areaCategorySysId
	 * @param businessCategorySysId
	 * @return
	 */
	public long getServantCount(long areaCategorySysId, long businessCategorySysId);

	/**
	 * get user served store list
	 * 
	 * @param userSysId
	 * @param storeSysId
	 * @param pgno
	 * @param pgsize
	 * @return
	 */
	public List<Store> getServeStoreList(long userSysId,long storeSysId, int pgno, int pgsize);

	/**
	 * get count of user served stores
	 * 
	 * @param userSysId
	 * @param storeSysId
	 * @return
	 */
	public long getServeStoreCount(long userSysId,long storeSysId);

	/**
	 * get user served product list
	 * @see  
	 * 
	 * @param userSysId
	 * @param pgno
	 * @param pgsize
	 * @return
	 */
	public List<Product> getSuppliedProductList(long userSysId, int pgno, int pgsize);

	/**
	 * get count of user served products
	 * 
	 * @param userSysId
	 * @return
	 */
	public long getSuppliedProductCount(long userSysId);

	/**
	 * add servant user to category trail
	 * 
	 * @param userSysId
	 * @param categorySysId
	 */
	public void addServant2CateogryTrail(long userSysId, long categorySysId);

	/**
	 * remove servant user from category trail
	 * 
	 * @param userSysId
	 * @param categorySysId
	 */
	public void removeServantFromCategoryTrail(long userSysId, long categorySysId);

	/**
	 * Register new product profile
	 *  
	 * @param supplierUserSysId
	 * @param product
	 * @return
	 */
	public Product registerSuppliedProductProfile(long supplierUserSysId,Product product);
	
	public boolean isProductSupplier(long userSysId,long productSysId);
	public boolean isStoreServant(long userSysId,long storeSysId);

}
